<title>网站用户</title>
  
<div class="layui-card layadmin-header">
  <div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">主页</a>
    <a><cite>用户</cite></a>
    <a><cite>网站用户</cite></a>
  </div>
</div>

<div class="layui-fluid">
  <div class="layui-card">
    <form class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="J_ajaxForm">
      <div class="layui-form-item">
        <div class="layui-inline">
          <label class="layui-form-label">ID</label>
          <div class="layui-input-block">
            <input type="text" name="id" placeholder="请输入" autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label class="layui-form-label">用户名</label>
          <div class="layui-input-block">
            <input type="text" name="username" placeholder="请输入" autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label class="layui-form-label">邮箱</label>
          <div class="layui-input-block">
            <input type="text" name="email" placeholder="请输入" autocomplete="off" class="layui-input">
          </div>
        </div>

        <div class="layui-inline">
          <input type="button" class="layui-btn" lay-submit lay-filter="J_form_search" value="搜索">
        </div>
      </div>
    </form>
    
    <div class="layui-card-body">
      <div style="padding-bottom: 10px;">
        <a class="layui-btn J_popup" lay-event="add" title="添加用户" role="button">添加</a>
        <a href="/user/del" class="layui-btn btn_action" data-type="del" role="button">删除</a>
      </div>
      
      <table id="J_table_list" lay-filter="J_table_list"></table>

    </div>
  </div>
</div>
<script type="text/html" id="J_popup_add">
<form class="layui-form" lay-filter="J_ajaxForm_info">

            <div class="layui-form-item">
              <label class="layui-form-label">用户名：</label>
              <div class="layui-input-block">
                <div class="layui-input-inline"><input type="text" name="username" value="" class="layui-input"></div>
              </div>
            </div>
            
            <div class="layui-form-item">
              <label class="layui-form-label">密码：</label>
              <div class="layui-input-block">
                <div class="layui-input-inline"><input type="password" name="password" value="" lay-verify="password" class="layui-input"></div>
              </div>
            </div>
 
             <div class="layui-form-item">
              <label class="layui-form-label">邮箱：</label>
              <div class="layui-input-block">
                <div class="layui-input-inline"><input type="text" name="email" value="" lay-verify="email" class="layui-input"></div>
              </div>
            </div>

            
            <div class="layui-form-item">
            <label class="layui-form-label">用户组</label>
            <div class="layui-input-inline">
              <select class="layui-select" name="group_id">
                <option value=""></option>
              </select>
            </div>
          </div>
            
            <div class="layui-form-item">
              <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="J_ajax_submit_btn">提交</button>
              </div>
            </div>
            
          </form>
</script>

      <script type="text/html" id="J_table_tool">
        <a href="../user/edit" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit" title="编辑用户" role="link">通过</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
      </script>
      
<script>
layui.use(['global', 'table'], function(){
  var $ = layui.$
  ,table = layui.table;

  //执行渲染
table.render({
  elem: '#J_table_list'
  ,url: '../user/list'
  ,cols: [[
      {type: 'checkbox'}
      ,{field:'id',title:'ID',width:80,align:'center',sort: true}
      ,{field:'username',title:'用户名',minWidth:150}
      ,{field:'register_time',title:'注册时间',width:200}
      ,{title:'操作',width:150,align:'center',toolbar:'#J_table_tool'}
  ]]
  ,page: true
    ,limit: 20
    ,height: 'auto'
  ,text: '对不起，加载出现异常！'
});

});
</script>